<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<title>测试环境设备列表</title>
	<link rel="stylesheet" type="text/css" href="/static/css/maintable.css"/>
	<script src="https://unpkg.com/vue"></script>
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>
	<div id="app">
		<div  class="content">
			<div class="contentitem">
				<table >
					<tr>
						<td>序号</td>
						<td>设备id</td>
						<td>广告牌名称</td>
						<td>
							操作
						</td>
					</tr>
					<tr v-for="(item,index) in total">
						<td>{{index+1}}</td>
						<td>{{item.device_id}}</td>
						<td>{{item.name}}</td>
						<td>
							<button  @click="goto(item.device_id)">跳转</button>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	var app =new Vue({
		el: '#app',
		data: {
			total:[]
		},
		mounted:function(){
			var that = this
			$.ajax({
				type:"post",
				url:"{:url('builder/getList')}",
				async:true
			}).then(function(res){
				if(res.success){
					that.total = res.data
				}
			});
		},
		methods:{
			goto:function(id){
				window.location.href="{:url('builder/builders','','')}/id/"+id
			}
		}
	})
</script>
</html>
